package com.example.customer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableEurekaClient
public class SpringcloudCustomerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringcloudCustomerApplication.class, args);

    }

    @Bean
    @LoadBalanced
    //负载均衡,负责服务调用，这样customer可以调用privider
    RestTemplate restTemplate() { //该模板是搞负载均衡的
        return new RestTemplate();
    }
}


